package com.bbc.yuntun.platform.config;

import com.bbc.yuntun.platform.interceptor.WxAuthInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 *
 * @author Wyy
 * @date 2022/7/21
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    @Resource
    private WxAuthInterceptor wxAuthInterceptor;

    /**
     * 添加拦截器
     *
     * @param registry 拦截器注册
     * @author wl
     * @date 2023/12/11 12:55
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(wxAuthInterceptor).addPathPatterns("/wx/**")
                .excludePathPatterns("/wx/auth/login","/wx/auth/test");
    }

}
